Skip to main content

Web Socket

  • WebSocket Protocol: WebSocket is a communications protocol that enables a persistent, bi-directional, full duplex TCP connection between a user’s web browser and a server.
    • Handshake Process: The protocol initiates with a handshake request from the browser, including a Sec-WebSocket-Key, and the server responds with a Sec-Websocket-Auth hash to prevent caching proxy issues1.
    • Persistent Connection: Unlike standard HTTP, WebSocket allows for a binary connection that stays open, allowing both server and user to send messages at any time2.
    • Event-Driven Web Programming: WebSocket facilitates event-driven programming by allowing communication to be initiated from either end, contrasting with HTTP where only users request new data3.